<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // 作业 [524,633,777,82,99,422,7778,20,6,44,523] // 大于300 统计求和
      let arr = [524, 633, 777, 82, 99, 422, 7778, 20, 6, 44, 523]
      let ddd = arr.reduce((item, index) => {
        if (item > 300) {
          return item + index
        }
      })
      console.log(ddd);
    </script>
  </body>
</html>
